import type { App } from 'vue'
import { ElMessageBox } from 'element-plus'
import { ElMessage } from 'element-plus/es'
import { Assist } from '@lhy-meta-web/utils'

export default {
  install(app: App) {
    Assist.setFeedback({
      success: message => {
        ElMessage.success(message)
      },
      info: message => {
        ElMessage.info(message)
      },
      warn: message => {
        ElMessage.warning(message)
      },
      error: message => {
        ElMessage.error(message)
      },
      confirm: async (message, title) => {
        await ElMessageBox.confirm(message, title)
      },
    })
  },
}
